<?php
	
	require_once "Control\LoginController.php";
	require_once "Control\FileUploadController.php";
	
	require_once "View\PageCompositionView.php";
	
	class Mastercontroller{
		
		public function DoControll(){
			
			$loginController = new LoginController();
			$fileuploadController = new FileUploadController();
			
			$pageCompositionView = new PageCompositionView();
			
			$loginReturnValue = $loginController->DoControll();
			$fileUploadReturnValue= $fileuploadController->DoControll($loginReturnValue->isLoggedIn);
			
			//Kontrollerar om man är inloggad genom loginController och bygger sedan ihop sidan utefter svaret.
			if($loginReturnValue->isLoggedIn) {
				
				$content = $loginReturnValue->html;
				$content .= $fileUploadReturnValue->html;
				
				$ret = $pageCompositionView->BuildPageBody("", $content, "");
				return $ret;
			} else {
				$content = $loginReturnValue->html;
				
				$ret = $pageCompositionView->BuildPageBody("<h1>Claes</h1>", $content, "");
				
				return $ret;
			}
			
			
		}
	}
?>